package com.hellobike.haxing.modules.product.entity;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import java.util.List;

import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.annotation.*;
import com.hellobike.haxing.modules.product.mapper.typehandler.JSONArrayHandler;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import com.hellobike.haxing.common.annotation.Dict;

/**
 * @Description: SPU
 * @Author: haxing-boot
 * @Date: 2020-01-10
 * @Version: V1.0
 */
@Data
@TableName(value = "t_spu", autoResultMap = true)
public class Spu implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 货品名称
     */
    @Excel(name = "货品名称", width = 15)
    private String spuName;
    /**
     * SPU编码
     */
    @Excel(name = "SPU编码", width = 15)
    private String spuCode;
    /**
     * 类型：1-生鲜 2-日杂
     */
    @Excel(name = "类型：1-生鲜 2-日杂", width = 15)
    private Integer type;
    /**
     * 一级分类id
     */
    @Excel(name = "一级分类id", width = 15)
    private Long categoryId1;
    /**
     * 二级分类id
     */
    @Excel(name = "二级分类id", width = 15)
    private Long categoryId2;
    /**
     * 三级分类id
     */
    @Excel(name = "三级分类id", width = 15)
    private Long categoryId3;
    /**
     * 规格属性
     */
    @Excel(name = "规格属性", width = 15)
    @TableField(typeHandler = JSONArrayHandler.class)
    private JSONArray dimensions;
    /**
     * 存储类型：1-常温、2-冷藏、3-冷冻
     */
    @Excel(name = "存储类型：1-常温、2-冷藏、3-冷冻", width = 15)
    private Integer storeType;
    /**
     * 品牌
     */
    @Excel(name = "品牌", width = 15)
    private String brand;
    /**
     * 保质期
     */
    @Excel(name = "保质期", width = 15)
    private Integer shelfLife;
    /**
     * 保质期单位：1-天、2-月、3-年
     */
    @Excel(name = "保质期单位：1-天、2-月、3-年", width = 15)
    private Integer shelfLifeUnit;
    /**
     * 生产日期
     */
    @Excel(name = "生产日期", width = 15)
    private String dateProduce;
    /**
     * 到期日期
     */
    @Excel(name = "到期日期", width = 15)
    private String dateDue;
    /**
     * 采购负责人
     */
    @Excel(name = "采购负责人", width = 15)
    private String purchasePerson;
    /**
     * 物流商品状态：1-正常、2-淘汰、3-试新
     */
    @Excel(name = "物流商品状态：1-正常、2-淘汰、3-试新", width = 15)
    private Integer logisticsStatus;
    /**
     * 销项税率
     */
    @Excel(name = "销项税率", width = 15)
    private BigDecimal sellTaxRate;
    /**
     * 进项税率
     */
    @Excel(name = "进项税率", width = 15)
    private BigDecimal purchaseTaxRate;
    /**
     * 采购规格
     */
    @Excel(name = "采购规格", width = 15)
    private String purchaseSpec;
    /**
     * 采购规格单位
     */
    @Excel(name = "采购规格单位", width = 15)
    private String purchaseSpecUnit;
    /**
     * 采购规格条码
     */
    @Excel(name = "采购规格条码", width = 15)
    private String purchaseSpecBarcode;
    /**
     * 订货规格
     */
    @Excel(name = "订货规格", width = 15)
    private String orderSpec;
    /**
     * 订货规格单位
     */
    @Excel(name = "订货规格单位", width = 15)
    private String orderSpecUnit;
    /**
     * 订货规格条码
     */
    @Excel(name = "订货规格条码", width = 15)
    private String orderSpecBarcode;
    /**
     * 产地
     */
    @Excel(name = "产地", width = 15)
    private String origin;
    /**
     * 产地类型：1-国内、2-国外
     */
    @Excel(name = "产地类型：1-国内、2-国外", width = 15)
    private Integer originType;
    /**
     * 状态：1-待提交、2-待审核、3-审核通过、4-审核拒绝、5-业务删除
     */
    @Excel(name = "状态：1-待提交、2-待审核、3-审核通过、4-审核拒绝、5-业务删除", width = 15)
    private Integer status;
    /**
     * 计量单位
     */
    @Excel(name = "计量单位", width = 15)
    private Integer unit;
    /**
     * 标品类型：0-非标品、1-标品
     */
    @Excel(name = "标品类型：0-非标品、1-标品", width = 15)
    private Integer standard;
    /**
     * 备货类型：0-非常备货、1-常备货
     */
    @Excel(name = "备货类型：0-非常备货、1-常备货", width = 15)
    private Integer stockType;
    /**
     * 净含量
     */
    @Excel(name = "净含量", width = 15)
    private String netContent;
    /**
     * 创建时间
     */
    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /**
     * 更新时间
     */
    @Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    /**
     * 创建人
     */
    @Excel(name = "创建人", width = 15)
    private Integer createBy;
    /**
     * 修改人
     */
    @Excel(name = "修改人", width = 15)
    private Integer updateBy;
    /**
     * 是否删除：0-否 1-是
     */
    @Excel(name = "是否删除：0-否 1-是", width = 15)
    @TableLogic
    private Integer deleted;


    /**一级分类名称*/
    @TableField(exist = false)
    private String categoryName1;
    /**二级分类名称*/
    @TableField(exist = false)
    private String categoryName2;
    /**三级分类名称*/
    @TableField(exist = false)
    private String categoryName3;


    /**
     * SKU列表
     */
    @TableField(exist = false)
    private List<Sku> skus;
}
